package com.liuqi.aiagent.util;

/**
 * @author liuqi
 * @date 2025/7/15
 **/
public final class StringUtil {

    public boolean isEmpty(String str) {
        return (str == null || "".equals(str));
    }

    public boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static boolean hasText(String str) {
        return (str != null && !str.isEmpty() && containsText(str));
    }

    public static boolean notHasText(String str) {
        return !hasText(str);
    }

    private static boolean containsText(CharSequence str) {
        int strLen = str.length();
        for (int i = 0; i < strLen; i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                return true;
            }
        }
        return false;
    }

}
